<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>

    <!-- 
        局部组件注册:
            Vue对象的 components 属性
        局部组件只能在注册它的父组件中使用
    -->
    <div id="app">
        <hello-world></hello-world>
        <hello-tom></hello-tom>
        <hello-jerry></hello-jerry>
        <test-com></test-com>
    </div>

    <script>
        Vue.component('test-com',{
            template:'<div>Test</div>'
        });
        var HelloWorld = {
            data:function(){
                return {
                    msg:'HelloWorld'
                };
            },
            template:`<div>{{msg}}</div>`
        };
        var HelloTom = {
            data:function(){
                return {
                    msg:'HelloTom'
                };
            },
            template:`<div>{{msg}}</div>`
        };
        var HelloJerry = {
            data:function(){
                return {
                    msg:'HelloJerry'
                };
            },
            template:`<div>{{msg}}</div>`
        };
        var vm = new Vue({
            el: "#app",
            data: {

            },
            components:{
                'hello-world':HelloWorld,
                'hello-tom':HelloTom,
                'hello-jerry':HelloJerry
            }
        })


    </script>


</body>

</html>